import serve from './index'
// 按需导出

// 获取页码数
export function getPages(name,departmentName, majorName) {
    return serve({
        url: '/admin/class/page/count',
        method: 'get',
        params: {
           name: name,
            departmentName: departmentName,
            majorName: majorName,
        }
    })
}

// 搜索
export function getList(page, name,departmentName, majorName ) {
    return serve({
        url: '/admin/class/page/' + page,
        method: 'get',
        params: {
            name: name,
            departmentName: departmentName,
            majorName: majorName,
        }
    })
}

// 获取全部专业
export function getListAll() {
    return serve({
        url: '/admin/major/names',
        method: 'get',
    })
}

// 添加
export function ADDList(grade, majorId, name) {
    return serve({
        url: '/admin/class',
        method: 'post',
        data: {
            grade: grade,
            majorId: majorId,
            name: name,
            id: -1,
        }
    })
}

// 更改
export function changeorno(grade, id,majorId,name) {
    return serve({
        url: '/admin/class',
        method: 'put',
        data: {
            grade:grade,
            id: id,
            majorId:majorId,
            name: name
        }
    })
}

// 删除
export function deleted(id) {
    return serve({
        url: '/admin/class/' + id,
        method: 'delete',
    })
}